import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute } from 'react-router';

import MainView from './MainView.jsx';
import RootView from './RootView.jsx';
import DrillView from './DrillView.jsx';
import TraceView from './TraceView.jsx';
import TraceGroupView from './TraceGroupView.jsx';
import history from '../common/history.es6';

render((
  <Router history={ history }>
    <Route path="/" component={MainView} >
      <Route path="domain/:domainId" component={DrillView} />
      <Route path="statuscode/:statuscode" component={DrillView} />
      <Route path="errorcode/:errorcode" component={DrillView} />
      <Route path="errortrace/:traceId" component={TraceView} />
      <Route path="errorgrouptrace/:statusCode/:domainId/:urlId" component={TraceGroupView} />
      <IndexRoute component={RootView} />
    </Route>
  </Router>
), document.getElementById('root'));
